#ifndef GETJSONDATA_H
#define GETJSONDATA_H
#include <QObject>
//#include "jsonhelper.h"
//#include "SqliteHelper.h"
#include <QUuid>
#include "globalobject.h"

using namespace Moolink;

class GetData: public QObject
{
public:
    GetData();

    static QVariantList getVariant_Device(int deviceid=0);
    static QVariantList getVariant_Code(int codeid=0);
    static QVariantList getVariant_Server(int serverid=0);
    static QVariantList getVariant_ServerSendTask(int serverid=0);

    static QVariantList getVariant_DeviceProtocolGroup();
    static QVariantList getVariant_DeviceProtocolByGroup(QString group);
    static QVariantList getVariant_DeviceProtocol(QString protocolId=QString("00000000000000000000000000000000"));
    static QVariantList getVariant_ServerProtocol(QString protocolId=QString("00000000000000000000000000000000"));



//DISTINCT
//    static QString getJSON_Device(int deviceid);
//    static QString getJSON_Devices();
//    static QString getJSON_Server(int serverid);
//    static QString getJSON_Servers();

    static QString getJSON_Device(int deviceid){return JsonHelper::getJson(getVariant_Device(deviceid));}
    static QString getJSON_Devices(){return JsonHelper::getJson(getVariant_Device());}

    static QString getJSON_Server(int serverid){return JsonHelper::getJson(getVariant_Server(serverid));}
    static QString getJSON_Servers(){return JsonHelper::getJson(getVariant_Server());}

    static QString getJSON_ServerProtocol(QString protocolId){return JsonHelper::getJson(getVariant_ServerProtocol(protocolId));}
    static QString getJSON_ServerProtocols(){return JsonHelper::getJson(getVariant_ServerProtocol());}

    static QString getJSON_DeviceProtocol(QString protocolId){return JsonHelper::getJson(getVariant_DeviceProtocol(protocolId));}
    static QString getJSON_DeviceProtocols(){return JsonHelper::getJson(getVariant_DeviceProtocol());}
    static QString getJSON_DeviceProtocolGroup(){return JsonHelper::getJson(getVariant_DeviceProtocolGroup());}


};

#endif // GETJSONDATA_H
